home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / M / MacOberon.cpt / MacOberonToolBoxInterface.sit / ToolBox.Tool (.txt) < prev   
Encoding:
Oberon Text  |  1990-08-31  |  3.3 KB  |  53 lines  |  [.Ob./.Ob*]

  1. Syntax10b.Scn.Fnt
  2. Syntax10.Scn.Fnt
  3. Syntax10i.Scn.Fnt
  4. MacOberon ToolBox Interfaces
  5. MacOberon offers a simple means for defining interfaces to the Macintosh
  6. Operating System and Toolbox.   A subset of these interfaces is already
  7. included with MacOberon and additions and further interface modules can
  8. be created easily.  Procedure definitions including a minus sign following
  9. the PROCEDURE symbol are treated as Interface Procedures; the compiler
  10. will substitute in-line the byte sequence appearing instead of a procedure
  11. body when compiling the procedure call.
  12. Data structures used by the Macintosh Operating System and Toolbox have
  13. an internal structure different from Oberon structures.  To differentiate
  14. between the two, these interface structures have to be marked by a plus
  15. sign following the ARRAY, POINTER or RECORD symbol.  Only basic types
  16. or interface structures may be passed to interface procedures.  If an interface
  17. structure is composed of smaller substructures, these must also be marked.
  18. Oberon structures, on the other hand, may contain interface substructures.
  19.     Compiler.Compile
  20.         MacTypes.Mod/s    MacQuickDraw.Mod/s    MacMenus.Mod/s
  21.         MacEvents.Mod/s    MacTextEdit.Mod/s    MacWindows.Mod/s
  22.         MacDesk.Mod/s    MacDialogs.Mod/s    ~
  23. SampleApp is an Oberon module that demonstrates how MacOberon may
  24. be used for constructing Applications that follow the Macintosh User Interface
  25. Guidelines.  It shows how to hide the MacOberon window, Arrow and Menu
  26. Bar and how to return to MacOberon in an orderly fashion.  In the event of a
  27. trap, Oberon's Menus and Arrow Cursor will automatically be restored.
  28.     Compiler.Compile SampleApp.Mod ~
  29.     SampleApp.Loop    (* Choose Quit from File menu to return to Oberon *)
  30. MacOberon uses resource numbers greater than 32000, while the Operating
  31. System reserves all numbers smaller than 128.  Numbers between these
  32. two values may be assigned freely to resources belonging to user commands.
  33. These resources may then be included in the MacOberon application, or
  34. alternatively may be stored in separate resource files.  SampleApp
  35. demonstrates how to access a resource file "SampleApp.r" (generated from
  36. SampleApp.Rez).
  37. When returning to the Main Loop of Oberon, user commands should restore
  38. the standard Oberon Menu by calling Display.ShowStdMenus .  If this is
  39. inadvertently omitted, the Main Loop will catch the error the next time
  40. an item is selected from the (improper) menu and cause a trap, resulting in
  41. the automatic reinstatement of the usual Oberon menus.  The procedure
  42. from module SampleApp which builds the menu bar may thus be called for
  43. testing purposes, without danger of damaging our Oberon environment.
  44.     SampleApp.SetupSampleLooks
  45. The "look and feel" of a user application may be tested without actually
  46. starting its main event loop, from within the Oberon environment.  Only
  47. when the behavior of the individual selectable actions is satisfactory, do we
  48. need to start with debugging the main loop.  As an example, the window
  49. creation action of SampleApp may be executed without actually going into
  50. "Macintosh User Interface" mode.
  51.     SampleApp.NewWindow
  52.                                                                                         Michael Franz, 31.08.90
  53.